package cn.tedu.boyou.common.query;

import lombok.Getter;
import lombok.Setter;

/**
 * 添加目的地拓展表后的查询条件
 */
@Setter@Getter
public class DestinationExtendQuery extends DestinationQuery{

    public static final int DAYS_NO_LIMIT = -1;
    public static final int DAYS_TWO_TO_THREE = 2;
    public static final int DAYS_FOUR_FIVE = 4;
    public static final int DAYS_SIX_NINE = 6;
    public static final int DAYS_MORE_THAN_TEN = 10;

    private Long themeId;

    private Long month;

    private Integer days = DAYS_NO_LIMIT;

    private Long destParentId;

    public DayRange getDayRange(){
        switch (days){
            case DAYS_TWO_TO_THREE :
                return new DayRange(2,3);
            case DAYS_FOUR_FIVE :
                return new DayRange(4,5);
            case DAYS_SIX_NINE :
                return new DayRange(6,9);
            case DAYS_MORE_THAN_TEN :
                return new DayRange(10,Integer.MAX_VALUE);
            default:
                return new DayRange(Integer.MIN_VALUE, Integer.MAX_VALUE);
        }
    }

    class DayRange{
        private Integer minDay;
        private Integer maxDay;
        DayRange(Integer minDay, Integer maxDay) {
            this.minDay = minDay;
            this.maxDay = maxDay;
        }
    }
}
